<!-- 查阅班级签到情况 -->
<template>
  <div class="">
    <el-card shadow="never">
      <p class="tag">{{ signName }}</p>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column type="index" width="50" label="序"> </el-table-column>
        <el-table-column prop="number" label="学号" >
        </el-table-column>
        <el-table-column prop="name" label="姓名" >
        </el-table-column>
        <el-table-column label="签到时间">
          <template slot-scope="scope">
            <span v-if="scope.row.signDateTime">
              {{ scope.row.signDateTime }}</span
            >
            <span v-else style="color: red">未签到</span>
          </template>
        </el-table-column>
        <el-table-column label="">
          <template slot-scope="scope">
            <el-button v-if="!scope.row.signDateTime" @click="changekSign(scope.row)" type="text" size="small"
              >更改状态</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      tableData: [
         {
          number: "201820205501",
          name: "张示范",
          signDateTime: "05-31 21:50:00",
        },
         {
          number: "201820205502",
          name: "李尚容",
          signDateTime: "05-31 21:50:00",
        },
        {
          number: "201820205503",
          name: "陈茂林",
          signDateTime: "05-31 21:50:00",
        },
         {
          number: "201820205504",
          name: "榆树林",
          signDateTime: "",
        },
         {
          number: "201820205505",
          name: "张欣",
          signDateTime: "05-31 21:50:00",
        },
         {
          number: "201820205506",
          name: "李世斌",
          signDateTime: "",
        },
          {
          number: "201820205507",
          name: "梨花金",
          signDateTime: "05-31 21:50:00",
        },
         {
          number: "201820205508",
          name: "何维",
          signDateTime: "05-31 21:50:00",
        },
        {
          number: "201820205509",
          name: "何洪超",
          signDateTime: "05-31 21:50:00",
        },
          {
          number: "201820205510",
          name: "陈凡",
          signDateTime: "05-31 21:50:00",
        },
         {
          number: "201820205511",
          name: "刘岩",
          signDateTime: "05-31 21:50:00",
        },
        {
          number: "201820205512",
          name: "马尔基",
          signDateTime: "05-31 21:50:00",
        },
      ],
      signName: "第一次签到",
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    /**
     * 手动更改学生签到状态
     */
    changekSign() {},
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
.tag {
  color: #909399;
  padding: 0 10px;
  font-size: 15px;
  white-space: nowrap;
}
</style>